package proc

import (
	"os/exec"
	"syscall"
)

func setProcessGroup(c *exec.Cmd, useLegacyStrategy bool) {
	if useLegacyStrategy {
		return
	}
	if c.SysProcAttr == nil {
		c.SysProcAttr = &syscall.SysProcAttr{CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP}
	} else {
		c.SysProcAttr.CreationFlags = syscall.CREATE_NEW_PROCESS_GROUP
	}
}
